#ifndef QAUGMENTEDREALITYCAMERAITEM_H
#define QAUGMENTEDREALITYCAMERAITEM_H

#include <QDeclarativeItem>
#include <QGeoCoordinate>

#include "qdll_global.h"

QTM_USE_NAMESPACE

class QAugmentedRealityPositionInfo {
public:
    float angle;
    float distance;
};

class QDLLSHARED_EXPORT QAugmentedRealityCameraItem : public QDeclarativeItem
{
    Q_OBJECT
    Q_CLASSINFO("Author", "Sebastiano Galazzo")
    Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
    Q_PROPERTY(float latitude  READ latitude  WRITE setLatitude)
    Q_PROPERTY(float longitude READ longitude WRITE setLongitude)
    Q_PROPERTY(QString message READ message WRITE setMessage)
    Q_PROPERTY(QString infoBox READ infoBox WRITE setInfoBox)
    Q_PROPERTY(QString source READ source WRITE setSource)

    Q_PROPERTY(float x READ x)
    Q_PROPERTY(float y READ y)
    Q_PROPERTY(float z READ z)

public:

    enum Roles {
        MessageRole = Qt::UserRole+1,
        LatitudeRole= Qt::UserRole+2,
        LongitudeRole = Qt::UserRole+3,
        InfoBoxRole = Qt::UserRole+4,
        SourceRole = Qt::UserRole+5
    };

    QAugmentedRealityCameraItem(QDeclarativeItem *parent = 0);
    virtual ~QAugmentedRealityCameraItem() {}

    QVariant data(int role) const;
    QHash<int, QByteArray> roleNames() const;

    QString id() const;
    float latitude() const;
    float longitude() const;
    QString message() const;
    QString infoBox() const;
    QString source() const;

    void setLatitude(float value );
    void setLongitude(float value );
    void setMessage(QString message );
    void setInfoBox(QString infoBox );
    void setSource(QString source );

    float x() const;
    float y() const;
    float z() const;

    QAugmentedRealityPositionInfo relativePosition(QGeoCoordinate, float angle);

signals:
  void dataChanged();

private:
    float m_latitude;
    float m_longitude;
    QString m_message;
    QString m_infobox;
    QString m_source;
};

#endif // QAUGMENTEDREALITYCAMERAITEM_H
